<template>
  <div
    class="btn"
    :class="{
      primary: type === 'primary',
      success: type === 'success',
      danger: type === 'danger',
    }"
  >
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    // 按钮使用场景
    type: {
      type: String,
    },
  },
};
</script>
<style scoped lang="less">
.btn {
  width: 95%;
  height: 40px;
  border-radius: 20px;
  background-color: #ccc;
  text-align: center;
  line-height: 40px;
  font-size: 16px;
  margin: 0 auto;
}

.primary {
  background-color: rgb(33, 88, 182);
  color: #fff;
}
.success {
  background-color: rgb(33, 182, 33);
  color: #fff;
}
.danger {
  background-color: rgb(193, 60, 37);
  color: #fff;
}
</style>